Skip to content

Conversation

@axosoft-ramint
Copy link
Contributor

Closes #4598
Closes #4599

New command is Recompose Commits (Preview) and is accessible from branches in views and graph, and from Command Palette.

@axosoft-ramint axosoft-ramint requested review from d13 and eamodio October 21, 2025 22:33
@axosoft-ramint axosoft-ramint added the area-composer Issues or features related to Commit Composer label Oct 21, 2025
@axosoft-ramint
Copy link
Contributor Author

Note: we have a bug with storing merge bases for branches at the moment (we are choosing the upstream rather than the upstream's merge base) which causes the composer to find no diff when you make a local branch from a remote one. I will address this separately and rebase this on top of it once it is addressed.

@axosoft-ramint axosoft-ramint force-pushed the feature/recompose-branch branch from 8561a88 to 7c9fab4 Compare October 24, 2025 18:15
@axosoft-ramint axosoft-ramint force-pushed the feature/recompose-branch branch from 099b6f0 to 07bf736 Compare November 3, 2025 15:55
@axosoft-ramint
Copy link
Contributor Author

Note: we have a bug with storing merge bases for branches at the moment (we are choosing the upstream rather than the upstream's merge base) which causes the composer to find no diff when you make a local branch from a remote one. I will address this separately and rebase this on top of it once it is addressed.

It was not a bug. It looked for the upstream only when the local wasn't available. But that logic wasn't working well in several cases (it would return zero commit responses), so I just used recursive merge target look-up until we find one with commits.

Comment on lines +646 to +660
export function parseCoAuthorsFromGitCommit(commit: GitCommit): GitCommitIdentityShape[] {
const coAuthors: GitCommitIdentityShape[] = [];
if (!commit.message) return coAuthors;

const coAuthorRegex = /^Co-authored-by:\s*(.+?)(?:\s*<(.+?)>)?\s*$/gm;
let match;
while ((match = coAuthorRegex.exec(commit.message)) !== null) {
const [, name, email] = match;
if (name) {
coAuthors.push({ name: name.trim(), email: email?.trim(), date: commit.date });
}
}

return coAuthors;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be great to add in other commit authorship/avatar content throughout GitLens.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will make a note to pull it into a shared util file later. Thanks!

Copy link
Member

@d13 d13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@axosoft-ramint axosoft-ramint force-pushed the feature/recompose-branch branch from 07bf736 to 12b86ff Compare November 6, 2025 15:25
@axosoft-ramint axosoft-ramint merged commit b85bba6 into main Nov 6, 2025
4 checks passed
@axosoft-ramint axosoft-ramint deleted the feature/recompose-branch branch November 6, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-composer Issues or features related to Commit Composer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow existing commits to be auto-recomposed with AI Recompose an entire branch in Composer

4 participants